#ifndef G_CODE_COMPILER_IMPLEMENTATION_H
#define G_CODE_COMPILER_IMPLEMENTATION_H

// provided interfaces
#include "cmdstream.h"
// required interfaces
#include "progmgr.h"
// basic component model
#include <bcm/bcm.h>
// implementation headers
#include "scanner.h"
#include "parser.h"

namespace cnc {

	namespace compiler {

		class GCodeCompilerImpl : public bcm::Identifier<CommandStream>
		{
		protected:
			ProgramManager *pmgr_;
			Scanner scanner_;
			Parser parser_;
		protected:
			GCodeCompilerImpl()
				: bcm::Identifier<CommandStream>("cmdstream", "Command Stream"),
				pmgr_(0) {}
			CommandStream *getCommandStream()
			{
				return static_cast<CommandStream *>(this);
			}
			void setProgramManager(ProgramManager *pmgr)
			{
				pmgr_ = pmgr;
			}
		protected: // Command Stream
		};

	} // namespace compiler

} // namespace cnc

#endif
